Skip to content

test(ui): add stale protect-check route regression#9095

Open
alexcarpenter wants to merge 1 commit into
mainfrom
carp/protect-check-standalone-signup-route-test
Open

test(ui): add stale protect-check route regression#9095
alexcarpenter wants to merge 1 commit into
mainfrom
carp/protect-check-standalone-signup-route-test

Conversation

@alexcarpenter

@alexcarpenter alexcarpenter commented Jul 6, 2026

Copy link
Copy Markdown
Member

Adds a failing route-level regression test for stale standalone SignUp protect-check visits after #9082. The existing stale-route test renders SignUpProtectCheck directly, but the real SignUp route wraps it in Route path="protect-check", where navigateToFlowStart currently no-ops because router.indexPath equals router.currentPath. This PR intentionally contains only the failing test.

Summary by CodeRabbit

  • Tests
    • Updated the sign-up protect-check coverage to follow the full sign-up flow through the app route.
    • Added assertions that the “verifying your request” screen is not shown during redirect and that the user returns to the sign-up page.
    • Confirmed the protect-check action is not triggered for stale standalone visits.

@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Jul 6, 2026 8:59pm
swingset Ready Ready Preview, Comment Jul 6, 2026 8:59pm

Request Review

@changeset-bot

changeset-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d026a8b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Updated a single test case in SignUpProtectCheck.test.tsx to render the <SignUp /> component instead of <SignUpProtectCheck /> directly, stubbing route matching for protect-check and asserting redirect to /sign-up without invoking executeProtectCheck.

Changes

Protect-check test update

Layer / File(s) Summary
Rewrite stale protect-check redirect test
packages/ui/src/components/SignUp/__tests__/SignUpProtectCheck.test.tsx
Test now renders <SignUp />, stubs router route matching for protect-check, asserts the verifying UI does not appear, and confirms redirect to /sign-up without calling mockExecute.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

  • clerk/javascript#8329: Adds/changes protect-check routing behavior for the prebuilt <SignUp /> flow that this test now exercises.

Suggested labels: react

Suggested reviewers: jacekradko

Poem

A hop, a skip, a route rewired,
The SignUp door now opens tired
No "verifying" pop-up shows,
Straight back to sign-up, off it goes!
🐇✨ Test cases clean, my whiskers glow.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the PR’s main change: a UI test regression for stale protect-check route handling.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/ui/src/components/SignUp/__tests__/SignUpProtectCheck.test.tsx`:
- Around line 78-91: This test is documenting a known broken flow, so it should
be marked as expected-to-fail rather than a normal passing test. Update the
SignUpProtectCheck test case in SignUpProtectCheck.test.tsx from a plain it(...)
to Vitest’s it.fails(...) (or another explicit expected-failure mechanism) so
the suite does not fail in CI while navigateToFlowStart and the protect-check
route behavior remain unfixed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Repository UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 8c1520c8-ff3c-4376-8c6f-b681b9f700c4

📥 Commits

Reviewing files that changed from the base of the PR and between 4aebb88 and d026a8b.

📒 Files selected for processing (1)
  • packages/ui/src/components/SignUp/__tests__/SignUpProtectCheck.test.tsx

Comment on lines +78 to +91
it('routes stale standalone protect-check visits through SignUp routes back to the flow start', async () => {
const { wrapper, fixtures } = await createFixtures(f => {
f.startSignUpWithEmailAddress();
});
fixtures.router.currentPath = '/sign-up/protect-check';
fixtures.router.fullPath = '/sign-up';
fixtures.router.indexPath = '/sign-up';
fixtures.router.matches.mockImplementation((path?: string) => path === 'protect-check');

render(<SignUp />, { wrapper });

await waitFor(() => expect(fixtures.router.navigate).toHaveBeenCalledWith('/sign-up'));
expect(mockExecute).not.toHaveBeenCalled();
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Mark this as an expected-to-fail regression test.

Per the PR objectives, this test is intentionally documenting a currently-broken behavior (navigateToFlowStart no-ops when routed through the real SignUp/Route path="protect-check" because indexPath equals the relative currentPath). As written, this is a plain it(...) block, so it will fail in CI once merged. Use Vitest's it.fails (or skip with a tracking-issue comment) so the suite doesn't break until the underlying fix lands.

🔧 Proposed fix
-  it('routes stale standalone protect-check visits through SignUp routes back to the flow start', async () => {
+  // TODO(`#XXXX`): navigateToFlowStart currently no-ops for routed protect-check visits.
+  it.fails('routes stale standalone protect-check visits through SignUp routes back to the flow start', async () => {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
it('routes stale standalone protect-check visits through SignUp routes back to the flow start', async () => {
const { wrapper, fixtures } = await createFixtures(f => {
f.startSignUpWithEmailAddress();
});
fixtures.router.currentPath = '/sign-up/protect-check';
fixtures.router.fullPath = '/sign-up';
fixtures.router.indexPath = '/sign-up';
fixtures.router.matches.mockImplementation((path?: string) => path === 'protect-check');
render(<SignUp />, { wrapper });
await waitFor(() => expect(fixtures.router.navigate).toHaveBeenCalledWith('/sign-up'));
expect(mockExecute).not.toHaveBeenCalled();
});
// TODO(`#XXXX`): navigateToFlowStart currently no-ops for routed protect-check visits.
it.fails('routes stale standalone protect-check visits through SignUp routes back to the flow start', async () => {
const { wrapper, fixtures } = await createFixtures(f => {
f.startSignUpWithEmailAddress();
});
fixtures.router.currentPath = '/sign-up/protect-check';
fixtures.router.fullPath = '/sign-up';
fixtures.router.indexPath = '/sign-up';
fixtures.router.matches.mockImplementation((path?: string) => path === 'protect-check');
render(<SignUp />, { wrapper });
await waitFor(() => expect(fixtures.router.navigate).toHaveBeenCalledWith('/sign-up'));
expect(mockExecute).not.toHaveBeenCalled();
});
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/ui/src/components/SignUp/__tests__/SignUpProtectCheck.test.tsx`
around lines 78 - 91, This test is documenting a known broken flow, so it should
be marked as expected-to-fail rather than a normal passing test. Update the
SignUpProtectCheck test case in SignUpProtectCheck.test.tsx from a plain it(...)
to Vitest’s it.fails(...) (or another explicit expected-failure mechanism) so
the suite does not fail in CI while navigateToFlowStart and the protect-check
route behavior remain unfixed.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-07-06T21:03:03.509Z

Summary

Metric Count
Packages analyzed 19
Packages with changes 0
🔴 Breaking changes 0
🟡 Non-breaking changes 0
🟢 Additions 0

No API Changes Detected

All packages have stable APIs with no detected changes.


Report generated by Break Check

Last ran on d026a8b.

@pkg-pr-new

pkg-pr-new Bot commented Jul 6, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@9095

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@9095

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@9095

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@9095

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@9095

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@9095

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@9095

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@9095

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@9095

@clerk/express

npm i https://pkg.pr.new/@clerk/express@9095

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@9095

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@9095

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@9095

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@9095

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@9095

@clerk/react

npm i https://pkg.pr.new/@clerk/react@9095

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@9095

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@9095

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@9095

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@9095

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@9095

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@9095

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@9095

commit: d026a8b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants